import fetch from 'common/src/utils/fetch'


/**
 * 根据条件，查询选课规则
 */
export function getRuleList(data) {
  return fetch({
    url: '/api/electionservice/electionRule/ruleList',
    method: 'post',
    data: data
  });
}

/**
 * 修改规则
 */
export function updateRule(data) {
  return fetch({
    url: '/api/electionservice/electionRule/updateRule',
    method: 'post',
    data: data
  });
}
/**
 * 修改参数状态
 */
export function updateParameter(data) {
  return fetch({
    url: '/api/electionservice/electionParameter/updateParameter',
    method: 'post',
    data: data
  });
}

/**
 * 修改参数状态
 */
export function batchUpdate(data) {
  return fetch({
    url: '/api/electionservice/electionRule/batchUpdate',
    method: 'post',
    data: data
  });
}

/**
 * 选课规则详情  groupId='+groupId
 */
export function ruleDeatil(id) {
  return fetch({
    url: '/api/electionservice/electionRule/ruleDeatil?id=' + id,
    method: 'get'
  });
}

// 新增限制课程
export function addLimitCourse(data) {
  return fetch({
    url: '/api/electionservice/electionRule/addLimitCourse',
    method: 'post',
    data: data
  });
}

// 修改限制课程
export function updateLimitCourse(data) {
  return fetch({
    url: '/api/electionservice/electionRule/updateLimitCourse ',
    method: 'post',
    data: data
  });
}

// 删除限制课程
export function deleteLimitCourse(data) {
  return fetch({
    url: '/api/electionservice/electionRule/deleteLimitCourse',
    method: 'post',
    data: data
  });
}
